#include <stdint.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>		/* ioctl */
#include "vtl.h"


int main(int argc, char **argv) {
    int f;
    void *buf;
    f = open("/home/bon/NetBeansProjects/os_ex3_chrdev/VTL", 0);
    printf("Opened device...%d\n", f);
    printf("Reading 1000...returned: %d bytes\n", read(f,buf,1000));
    printf("Writing 1000...returned: %d bytes\n", write(f,buf,1000));
    printf("Sending IOCTL: %d\n", ioctl(f,IOCTL_REPLACE_TAPE, 111));
    printf("Sending IOCTL: %d\n", ioctl(f,IOCTL_CREATE_TAPE, 111));
    printf("Closing..\n");
    close(f);
    return 0;
}
